package admin

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/admin/system"
)

func (c *ControllerSystem) ConfigCreate(ctx context.Context, req *system.ConfigCreateReq) (res *system.ConfigCreateRes, err error) {
	res = new(system.ConfigCreateRes)
	res.Id, err = service.SystemConfig().Create(ctx, model.SystemConfigCreateInput{
		CategoryId:    req.CategoryID,
		Code:          req.Code,
		Name:          req.Name,
		Content:       req.Content,
		Remark:        req.Remark,
		IsAllowDelete: req.IsAllowDelete,
	})
	return
}
